﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using EnvironmentalMonitor.Support.Module.Manage;

namespace EnvironmentalMonitor.Support.Module.Environmental
{
    /// <summary>
    /// 岗位和设备关系
    /// </summary>
    public class PostMachine : EnvironmentalMonitor.Support.Module.AbstractModule
    {
        private string _PostId;
        /// <summary>
        /// 岗位编号
        /// </summary>
        public string PostId
        {
            get
            {
                return this._PostId;
            }
            set
            {
                this._PostId = value;
            }
        }

        private string _MachineId;
        /// <summary>
        /// 设备编号
        /// </summary>
        public string MachineId
        {
            get
            {
                return this._MachineId;
            }
            set
            {
                this._MachineId = value;
            }
        }

        private Post _Post;
        /// <summary>
        /// 岗位
        /// </summary>
        public Post Post
        {
            get
            {
                return this._Post;
            }
            set
            {
                this._Post = value;
            }
        }

        private Machine _Machine;
        /// <summary>
        /// 设备
        /// </summary>
        public Machine Machine
        {
            get
            {
                return this._Machine;
            }
            set
            {
                this._Machine = value;
            }
        }

        /// <summary>
        /// 岗位名称
        /// </summary>
        public string PostName
        {
            get
            {
                string result = string.Empty;
                if (this.Post != null)
                {
                    result = this.Post.Name;
                }
                return result;
            }
        }

        /// <summary>
        /// 设备名称
        /// </summary>
        public string MachineName
        {
            get
            {
                string result = string.Empty;
                if (this.Machine != null)
                {
                    result = this.Machine.Name;
                }
                return result;
            }
        }

        /// <summary>
        /// 机房名称
        /// </summary>
        public string RoomName
        {
            get
            {
                string result = string.Empty;
                if (this.Machine != null)
                {
                    result = this.Machine.RoomName;
                }
                return result;
            }
        }
    }
}
